package com.iwhalecloud.bss.kite.cucc.web.controller.map;

import com.iwhalecloud.bss.kite.client.dto.DataResult;
import com.iwhalecloud.bss.kite.common.constant.ErrorConsts;
import com.iwhalecloud.bss.kite.cucc.client.api.map.IMapAidQueryService;
import com.iwhalecloud.bss.kite.cucc.client.dto.map.MapAidTokenReqDTO;
import com.iwhalecloud.bss.kite.cucc.client.dto.map.MapAidTokenRspDTO;
import com.iwhalecloud.bss.kite.manager.transaction.KiteTransactional;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description 地图辅助查询视图
 * @Author deng.gang
 * @Date 2022/2/17 8:24 下午
 */
@RestController
@RequestMapping("/map")
@Api(tags = { "/map - 地图" })
public class MapAidQueryController {

    @Autowired
    private IMapAidQueryService mapAidQueryService;

    @KiteTransactional
    @ApiOperation(value = "鉴权服务", notes = "鉴权服务")
    @PostMapping("/getToken")
    public DataResult<MapAidTokenRspDTO> getToken(@RequestBody MapAidTokenReqDTO mapAidTokenReqDTO) {
        return ErrorConsts.SUCCESS.getResult(mapAidQueryService.getToken(mapAidTokenReqDTO));
    }

}
